package com.fw.service.persistence.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.fw.service.persistence.dto.Transaction;

public interface TransactionDAO extends JpaRepository<Transaction, Long>, JpaSpecificationExecutor<Transaction> {
    @Query("select t from Transaction t where t.inboundMessageLogId = :inboundMessageLogId")
    public Transaction findByInboundMessageLogId(@Param("inboundMessageLogId") Long inboundMessageLogId);

    // @Query("select t from Transaction t where t.outboundMessageLogId = :outboundMessageLogId")
    // public Transaction findByOutboundMessageLogId(@Param("outboundMessageLogId") Long outboundMessageLogId);

    @Query("select t from Transaction t where t.invoiceNo = :invoiceNo")
    public Transaction findByInvoiceNo(@Param("invoiceNo") String invoiceNo);

}
